<?php
/**
 * The template for displaying attachments.
 *
 * @package toekneestuck
 * @subpackage toekneestuck
 * @since toekneestuck 2.0
 */
 
/** If this is a project item, load the projects template **/
if( !empty($post->post_parent) && get_post_type( $post->post_parent ) == 'projects' ):
	
	query_posts(array(
		'page_id' => $post->post_parent,
		'post_type' => 'projects',
		'toeknee_attachment_id' => $post->ID,
		'toeknee_real_title' => get_the_title()
	));
	
	get_template_part('single-projects');
	
else:

/** Otherwise, proceed as normal **/
get_header(); ?>
<div class="container" role="main">
	<div class="row">
		<?php get_template_part( 'loop', 'attachment' ); ?>
	</div>
</div>
<?php get_footer(); 

endif; ?>